package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepTrainTestMapper;
import com.ruoyi.deeplearn.domain.DeepTrainTest;
import com.ruoyi.deeplearn.service.IDeepTrainTestService;

/**
 * 训练测试数据集Service业务层处理
 * 
 * @author rww
 * @date 2022-12-10
 */
@Service
public class DeepTrainTestServiceImpl implements IDeepTrainTestService 
{
    @Autowired
    private DeepTrainTestMapper deepTrainTestMapper;

    /**
     * 查询训练测试数据集
     * 
     * @param id 训练测试数据集主键
     * @return 训练测试数据集
     */
    @Override
    public DeepTrainTest selectDeepTrainTestById(Long id)
    {
        return deepTrainTestMapper.selectDeepTrainTestById(id);
    }

    /**
     * 查询训练测试数据集列表
     * 
     * @param deepTrainTest 训练测试数据集
     * @return 训练测试数据集
     */
    @Override
    public List<DeepTrainTest> selectDeepTrainTestList(DeepTrainTest deepTrainTest)
    {
        return deepTrainTestMapper.selectDeepTrainTestList(deepTrainTest);
    }

    /**
     * 新增训练测试数据集
     * 
     * @param deepTrainTest 训练测试数据集
     * @return 结果
     */
    @Override
    public int insertDeepTrainTest(DeepTrainTest deepTrainTest)
    {
        deepTrainTest.setId(IdUtil.getSnowflakeNextId());
        deepTrainTest.setCreateTime(DateUtils.getNowDate());
        return deepTrainTestMapper.insertDeepTrainTest(deepTrainTest);
    }

    /**
     * 修改训练测试数据集
     * 
     * @param deepTrainTest 训练测试数据集
     * @return 结果
     */
    @Override
    public int updateDeepTrainTest(DeepTrainTest deepTrainTest)
    {
        deepTrainTest.setUpdateTime(DateUtils.getNowDate());
        return deepTrainTestMapper.updateDeepTrainTest(deepTrainTest);
    }

    /**
     * 批量删除训练测试数据集
     * 
     * @param ids 需要删除的训练测试数据集主键
     * @return 结果
     */
    @Override
    public int deleteDeepTrainTestByIds(Long[] ids)
    {
        return deepTrainTestMapper.deleteDeepTrainTestByIds(ids);
    }

    /**
     * 删除训练测试数据集信息
     * 
     * @param id 训练测试数据集主键
     * @return 结果
     */
    @Override
    public int deleteDeepTrainTestById(Long id)
    {
        return deepTrainTestMapper.deleteDeepTrainTestById(id);
    }
}
